<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">

<f:view contentType="text/html" id="fview">

	<f:loadBundle var="text" basename="#{basePage.bundleName}" />

	<h:head>
		<meta http-equiv="Cache-Control" content="no-store" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="icon" href="/images/favicon.ico" />
		<title>#{text['webapp.name']}</title>

		<link
			href="#{facesContext.externalContext.requestContextPath}/styles/lib/bootstrap-2.3.2.min.css"
			rel="stylesheet" type="text/css" />
		<link
			href="#{facesContext.externalContext.requestContextPath}/styles/lib/bootstrap-responsive-2.3.2.min.css"
			rel="stylesheet" type="text/css" />
		<link
			href="#{facesContext.externalContext.requestContextPath}/styles/style.css"
			rel="stylesheet" type="text/css" />

		<script type="text/javascript"
			src="#{facesContext.externalContext.requestContextPath}/scripts/lib/bootstrap-2.3.2.min.js"></script>
		<script type="text/javascript"
			src="#{facesContext.externalContext.requestContextPath}/scripts/lib/plugins/jquery.cookie.js"></script>
		<script type="text/javascript"
			src="#{facesContext.externalContext.requestContextPath}/scripts/script.js'/>"></script>

	</h:head>
	<script type="text/javascript">

				function createFormElement(element, type, name, id, value, parent) {
				    var e = document.createElement(element);
				    e.setAttribute("name", name);
				    e.setAttribute("type", type);
				    e.setAttribute("id", id);
				    e.setAttribute("value", value);
				    parent.appendChild(e);
				}

				function confirmDelete(obj) {
				    var msg = "Are you sure you want to delete this " + obj + "?";
				    ans = confirm(msg);
				    return ans;
				}

				function confirmMessage(obj) {
				    var msg = "" + obj;
				    ans = confirm(msg);
				    return ans;
				}
	
				
				</script>

	<h:body>
		<c:set var="currentMenu" scope="request">#{basePage.currentMenu}</c:set>
		<div class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container-fluid">
					<button type="button" class="btn btn-navbar" data-toggle="collapse"
						data-target=".nav-collapse">
						<span class="icon-bar"></span> <span class="icon-bar"></span> <span
							class="icon-bar"></span>
					</button>
					<a class="brand" href="/"><p:graphicImage
							value="/images/home.png" /> </a>
					<ui:include src="menu.xhtml" />
				</div>
			</div>
		</div>

		<div class="container-fluid">
			<ui:include src="messages.xhtml" />
			<div class="row-fluid">
				<div class="span3">
					<c:if test="${fn:contains(currentMenu, 'admin')}">
						<ui:include src="menu-admin.xhtml" />
					</c:if>
					<c:if test="${fn:contains(currentMenu, 'vente')}">
						<ui:include src="menu-vente.xhtml" />
					</c:if>
					<c:if test="${fn:contains(currentMenu, 'echange')}">
						<ui:include src="menu-echange.xhtml" />
					</c:if>
					<c:if test="${fn:contains(currentMenu, 'stock')}">
						<ui:include src="menu-stock.xhtml" />
					</c:if>
				</div>
				<div class="span9">
					<ui:insert name="content" />
				</div>
			</div>
		</div>

		<div id="footer">
			<span class="left">#{text['webapp.version']} <c:if
					test="${pageContext.request.remoteUser != null}">
            | #{text['user.status']} ${pageContext.request.remoteUser}
            </c:if> </span> <span class="right"> &copy;
				#{text['copyright.year']} <a href="#{text['company.url']}">#{text['company.name']}</a>
			</span>
		</div>

		<p:ajaxStatus
			style="width:64px;height:64px;position:fixed;right:5px;bottom:5px">
			<f:facet name="start">
				<p:graphicImage value="/images/ajax-loader.gif" />
			</f:facet>

			<f:facet name="complete">
				<h:outputText value="" />
			</f:facet>
		</p:ajaxStatus>
	</h:body>

</f:view>
</html>
